import http from "../utils/request";

//获取vip产品
export const getVipProducts = (product_id) =>
  http.get("/product/get_product?category_id=20210827165510715",{
    params:{
      product_id:product_id
    }
  });

//下单接口
export const addOrder = (product_id, quantity) =>
  http.post("/order/pre_order", {
    product_id: product_id,
    quantity: quantity,
  });

//发起支付接口
export const payment = (order_id) =>
  http.post("/pay/payment", {
    order_id: order_id,
  });

//查询支付结果接口
export const qqueryResults = (order_id) =>
  http.get("/pay/payment", {
    params: {
      order_id: order_id,
    },
  });

  
  //删除订单
export const delOrder = (order_id) =>
  http.get("/order/del_order", {
    params: {
      order_id: order_id
    },
  });
  
  //获取订单
export let getOrder = (order_id = "") =>
  http.post("/order/get_order", { order_id });

  //生成预支付订单

export const perOrder = (order_id) =>
  http.get("/order/query_order_status", {
    params: {
      order_id: order_id
    },
  });